<?php

/**
 * Basic interface of the "pseudo" OR-Mapper
 *
 */
interface Mapper
{
    /**
     * One function iterator, untyped php only.
     * Does not support false values. Has to be tested strict !== false in some cases
     * while ($o = $this->get($id)) {
     *     $ret[$id] = $o;
     * }
     * 
     * Iterate through the data return one per one
     * @param reference int $id ID
     * @return obj/array or bool false if there is nothing to get
     */
    public function get(&$id = NULL);
    /**
     * Get the complete or rest data
     * @return array of data
     */
    public function getAll();

    /**
     * Inform the Mapper about changes in the data array
     * The array is recognized by it's id
     * @param array $data
     */
    public function inform(array $data);
}

class MapperException extends PhException
{}